# 抽象产品类
from abc import ABC, abstractmethod

class Product(ABC):
    @abstractmethod
    def show(self):
        pass

# 具体产品A类
class ProductA(Product):
    def show(self):
        print("生产出了产品A")

# 具体产品B类
class ProductB(Product):
    def show(self):
        print("生产出了产品B")

# 抽象工厂类
class Factory(ABC):
    @abstractmethod
    def manufacture(self):
        pass

# 工厂A类 - 生产A类产品
class FactoryA(Factory):
    def manufacture(self):
        return ProductA()

# 工厂B类 - 生产B类产品
class FactoryB(Factory):
    def manufacture(self):
        return ProductB()

# 生产工作流程
if __name__ == "__main__":
    # 客户要产品A
    factoryA = FactoryA()
    factoryA.manufacture().show()

    # 客户要产品B
    factoryB = FactoryB()
    factoryB.manufacture().show()
